package test;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;


public class ProvaRandomAccess {
	
	public static void main(String[] args) throws IOException {
		

		try { 

            File f = new File("src/undo.txt");

           FileInputStream fis = new FileInputStream(f);

            byte[] content = new byte[fis.available()];

            fis.read(content);

            String data = new String(content);

           

         String[] split = data.split(System.getProperty("line.separator"));

            String lastLine = "";

            
            if(split.length > 0){
            	
            	for (int i = split.length;i>0;i--){
            		lastLine = split[i-1];
            		System.out.println(lastLine);
            	}
            }

      } catch (Exception e) {

            // TODO Auto-generated catch block

            e.printStackTrace();

      }

		
	}
}
